<?php

namespace app\api\services\admin\setting;

use app\api\common\service\BaseServices;
use app\api\common\traits\ServicesTrait;
use app\api\dao\admin\setting\DeptDao;

/**
 * 部门管理
 * Class UserServices
 *
 * @package app\services\admin
 * @method deleteLog() 定期删除日志
 */
class DeptServices extends BaseServices
{
    use ServicesTrait;

    /**
     * 构造方法
     * UserServices constructor.
     *
     * @param \app\api\dao\admin\setting\DeptDao $dao
     */
    public function __construct(DeptDao $dao)
    {
        $this->dao = $dao;
    }

    /**
     * @param $where
     *
     * @return array
     * @throws \ReflectionException
     */
    public function select($where): array
    {
        [$page, $limit] = $this->getPageValue(false);
        $list  = $this->dao->selectList($where, '*', $page, $limit, 'id ASC', [], true)->toArray();
        $count = $this->dao->count($where);
        return compact('list', 'count');
    }


}
